package service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.CommentMapper;
import model.Comment;
import service.CommentService;

@Service
public class CommentServiceImpl implements CommentService {

	@Autowired
	private CommentMapper commentMapper;

	@Override
	public Map<String, Object> getCommentByUser(long userId) {
		return commentMapper.getCommentByUser(userId);
	}

	@Override
	public Integer getCommentAverageScoreByUser(long userId) {
		return commentMapper.getCommentAverageScoreByUser(userId);
	}

	@Override
	public List<Comment> getCommentByOrderId(String orderId) {
		return commentMapper.getCommentByOrderId(orderId);
	}

	@Override
	public int addComment(Comment comment) {
		return commentMapper.insert(comment);
	}

	
}